#include "SocketManager.h"

using namespace OOPUtils;
using namespace std;
using namespace OOPNetwork;



SocketManager::SocketManager ()
{
  //Init Windows Socket
  WSADATA  Ws;
  if ( WSAStartup(MAKEWORD(2,2), &Ws) != 0 )
    throw ("Init Windows Socket Failed.");
}



SocketManager::~SocketManager ()
{
  WSACleanup();
}



OOPPtr< SocketListener > SocketManager::getSocketListener (
  unsigned short port, const string & ip) const
{
  return new SocketListener (port, ip);
}



OOPPtr< SocketClient > SocketManager::getSocketClient () const
{
  return new SocketClient ();
}

